define(["jquery","template","as/app/dst/dstDetail.servers","as/template/dst/dstDetail.tpl"],
	function($,template,$servers,tpl){
	var ui = {};

	var drawInfo = function(data){
		return template("dstDetail_info",data);
	}
	var drawTab = function(data){
		return template("dstDetail_tab",data);
	}
	var drawDefinedMonth = function(data){
		return template("dstDetail_definedMonth",data);
	}
	var drawQuest = function(data){
		return template("dstDetail_quest",data);
	}
	var drawScene = function(data){
		return template("dstDetail_scene",data);
	}
	var drawEnd = function(data){
		return template("dstDetail_end",data);
	}
	var drawTip = function(data){
		return template("dstDetail_tip",data);
	}
	var drawEmpty = function(data){
		return template("dstDetail_empty",data);
	}

	ui.info = function(options){
		// 默认是false; flag；true为简单版基本信息；false为全部基本信息
		options.flag ? $.extend(options.info,{"flag":options.flag}) : $.extend(options.info,{"flag":false});
		options.dom.html(tpl.info());
		var h = drawInfo($servers.handleInfo(options.info));
		options.dom.html(h);
	}

	ui.tab = function(options){
		$("#" + options.id).html(tpl.tab());
		var h = drawTab($servers.handleTab(options.list));
		$("#" + options.id).html(h);
	}

	ui.definedMonth = function(options){
		$("#" + options.id).html(tpl.definedMonth());
		//var h = drawDefinedMonth($servers.getMonthSelect());
		var h = drawDefinedMonth(options);
		$("#" + options.id).html(h);
	}

	ui.quest = function(options){
		$("#" + options.id).html(tpl.quest());
		var h = drawQuest(options.data);
		$("#" + options.id).html(h);
	}

	ui.scene = function(options){
		$("#" + options.id).html(tpl.scene());
		var h = drawScene(options);
		$("#" + options.id).html(h);
	}

	ui.end = function(options){
		options.dom.html(tpl.end());
		var h = drawEnd(options.data);
		options.dom.html(h);
	}

	ui.tip = function(options){
		options.dom.html(tpl.tip());
		var h = drawTip(options.data);
		options.dom.html(h);
	}

	ui.empty = function(options){
		options.dom.html(tpl.empty());
		var h = drawEmpty(options.data);
		options.dom.html(h);
	}

	return ui;
});